<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="maximum-scale=1,minimum-scale=1,user-scalable=0,width=device-width,initial-scale=1"><meta name="format-detection" content="telephone=no,email=no,date=no,address=no"><link rel="stylesheet" href="../../../global/css/aui.css"></head><body><header class="aui-bar aui-bar-nav" id="aui-header"><a class="aui-btn aui-pull-left" tapmode onclick="views.closeWin();"><img class="auix-icon-left" src="../../../global/image/icon-left.png"></a><div class="aui-title" tapmode onclick="frmToTop();"></div><span id="task-status" class="aui-btn aui-pull-right"></span></header></body><script id="tpl-task-status" type="text/x-dot-template"><a class="aui-btn aui-pull-right" data-status="{{=it.status}}" tapmode onclick="changeTaskStatus(this);">
        <span style="font-size:0.7rem;color:#333;">
            {{?it.status==2}}
            上线
            {{?? it.status==0}}
            下线
            {{?}}
        </span>
    </a></script><script src="../../../config.js"></script><script src="../../../global/script/lib/api.js"></script><script src="../../../global/script/lib/doT.min.js"></script><script src="../../../global/script/mylib.js"></script><script src="../../../app.js"></script><script type="text/javascript">apiready = function(){
        window.app.init4Win();
		$api.dom('.aui-title').innerHTML = api.pageParam.title;
        var header = $api.byId('aui-header');
        $api.fixStatusBar(header);
        var headerPos = $api.offset(header);
        var body_h = $api.offset($api.dom('body')).h;
        apix.openFrame({
            name: 'frm-task-center',
            url: './frm.html',
            rect: {
                x: 0,
                y: headerPos.h,
                w: 'auto',
                h: 'auto'
            },
			pageParam: api.pageParam,
            reload: true  // 重要，必须有！为了在头条frm打开时，再点通知，仍需跳到帖子
        })
        dynCfg.getTaskStatus('#task-status','#tpl-task-status');
        evt.listenTo('frmToTop',function(data){
              frmToTop('frm-task-center');// 回到顶部
        })
    };
    function changeTaskStatus(el){
        var q = {
            status:$api.attr(el,'data-status') == 2 ? 0 : 2,
            uid:app.auth.getMyId()
        }
         ajax_get('wuchen/update_task_user_status.php',q, {
            succ: function(json) {
                dynCfg.getTaskStatus('#task-status','#tpl-task-status');
                if(q.status == 2){
                    utils.toast('已下线');
                }
                if(q.status == 0){
                    utils.toast('已上线');
                }
                evt.send('wemedia-state',{});
            },
            fail: function(err, url) {
                utils.postErrWithTips(err, url);
            }
        });
    }</script></html>